package com.qf.springBeanLifecyleDemo.entity;

/**
 * @author 刘欣
 * @createTime 2022/12/28 18:53
 * @description
 */

public class User {
    private String name;
    private String password;
    private Integer age;

    public void setName(String name) {
        System.out.println("调用setName方法DI注入");
        this.name = name;
    }

    public void setPassword(String password) {
        System.out.println("调用setPassword方法DI注入");
        this.password = password;
    }

    public void setAge(Integer age) {
        System.out.println("调用setAge方法DI注入");
        this.age = age;
    }

    public void init() {
        System.out.println("user对象初始化方法");
    }

    public void destroy() {
        System.out.println("user对象销毁对象的方法");
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", age=" + age +
                '}';
    }
}
